package com.ymatou.iapi.liveinfo.service;

import org.json.JSONArray;
import org.json.JSONObject;

import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*根据多个直播id获取直播列表Call
*FreeMaker Template自动生成代码
*/
public class GetSellerLatestLiveCall extends YmatouBaseCall{
	private static String opurl ="api/Activity/GetSellerLatestLive";
	
	public GetSellerLatestLiveCall() {
		super(EnvSetup.getSystemUrl("liveinfo"),opurl,"GET","PARAM");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	/**
	 * 获取Data
	 * 
	 * @return Data
	 */
	public JSONObject getData() {
		JSONObject Data = null;
		try {
			JSONObject jo = new JSONObject(getReturnData());
			Data = jo.getJSONObject("Data");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Data;
	}
	
	/**
	 * 获取Data
	 * 
	 * @return Data
	 */
	public String getDataIsNull() {
		String Data = null;
		try {
			Data = new JSONObject(getReturnData()).getString("Data");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Data;
	}
	
	
	/**
	 * 获取code
	 * @return
	 */
	public int getCode() {
		int code = 0;
		try {
			code = new JSONObject(getReturnData()).getInt("Code");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return code;
	}
	/**
	 * 获取msg
	 * @return
	 */
	public String getMsg() {
		String msg = "";
		try {
			msg = new JSONObject(getReturnData()).getString("Msg");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return msg;
	}
	/**
	 * 获取BCode
	 * @return
	 */
	public int getBCode() {
		int BCode = 0;
		try {
			BCode = new JSONObject(getReturnData()).getInt("BCode");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return BCode;
	}
	/**
	 * 获取ServerTime
	 * @return
	 */
	public String getServerTime() {
		String ServerTime = "";
		try {
			ServerTime = new JSONObject(getReturnData()).getString("ServerTime");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return ServerTime;
	}
	
	/**
	 *获取BrandList集合
	 * @return
	 */
	public JSONArray GetBrandList()
	{
		JSONArray Data = null;
		try {
			JSONObject jo = new JSONObject(getReturnData());
			Data = jo.getJSONObject("Data").getJSONArray("BrandList");
		} catch (Exception e) {
			e.printStackTrace();
		}
	  return Data;
	}
	/**
	 *获取ProductList集合
	 * @return
	 */
	public JSONArray GetProductList()
	{
		JSONArray Data = null;
		try {
			JSONObject jo = new JSONObject(getReturnData());
			Data = jo.getJSONObject("Data").getJSONArray("ProductList");
		} catch (Exception e) {
			e.printStackTrace();
		}
	  return Data;
	}
}